# -*- coding: utf-8 -*-
# @Time    : 2021/10/30 0:45
# @Author  : TangDagui
# @Email   : 3297364807@qq.com
# @File    : PythonOne.py
# @Software: PyCharm

l = [1, 2, 5, 7, 10, 31, 44, 47, 56, 99, 102, 130, 240]
m = eval(input('输入查找值'))


def binary_search(l, num):
    if len(l) == 1:
        if l[0] == num:
            print('找到值')
        else:
            print('没有找到')
            return
    mid_index = len(l) // 2
    mid_value = l[mid_index]
    if num == mid_value:
        print('找到值')
        return
    if num > mid_value:
        l = l[mid_index:]
    if num < mid_value:
        l = l[:mid_index]

    binary_search(l, num)


binary_search(l, m)